var express = require('express');
var router = express.Router();
const hotService = require('../service/hotService');
router.get('/',async function(req, res, next) {
    let {type,value,current,size} = req.query;
    let searchObj = {};
    if(type){
        searchObj[type] = {$regex:value};
    }
    let data = await hotService.find(searchObj,{current:current||1,size:size||5});
    res.send(data);
});

module.exports = router;
